class Domain:
    instances = []
    def __init__(self):
        print("Domain Created")
        Domain.instances.append(self)
        self.command = "Domain *theDomain = new Domain();\n"
        self.command += "int i = 1;\nint j = 1;\n"
    def include(self):
        return ["stdlib.h", "StandardStream.h", "OPS_Globals.h", "ArrayOfTaggedObjects.h", "OPS_Stream.h", "DOF_Numberer.h", "Domain.h", "ID.h"]
    def command(self):
        return self.command

class Node:
    Counter = 0
    nlist = []
    instances = []
    def __init__(self, n, x, y, z, dof=6):
        self.n = n
        self.x = float(x)
        self.y = float(y)
        self.z = float(z)
        self.dof = dof
        Node.Counter += 1
        Node.instances.append(self)
        self.command = "Node *node%d = new Node(%d, %d, %f, %f, %f);\ntheDomain->addNode(node%d);\n" % (self.n, self.n, self.dof, self.x, self.y, self.z, self.n)
        if self.n in Node.nlist:
            Error("There's already a Node No.%d" % self.n)
        else:
            Node.nlist.append(n)

    def x(self):
        return self.x

    def y(self):
        return self.y

    def z(self):
        return self.z

    def n(self):
        return self.n

    def dof(self):
        return self.dof

    def include(self):
        return ["Node.h"]

    def command(self):
        return self.command